// 入口文件
import Vue from 'vue'
// 根组件
import App from './App.vue'
// 路由
import router from './router'
// elementUI组件
import './plugins/element.js'
// 导入全局样式表
import './assets/css/global.css'
// 导入字体图标
import './assets/font/iconfont.css'
// 导入axios用于发起请求
import axios from 'axios'
import TreeTable from 'vue-table-with-tree-grid'
// 设置请求的根路径
axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/'
axios.interceptors.request.use(config => {
  config.headers.Authorization = window.sessionStorage.getItem('token')
  console.log(config)
  return config
})

Vue.prototype.$http = axios
Vue.config.productionTip = false
Vue.component('tree-table', TreeTable)
// Vue实例
new Vue({
  // 挂载路由在Vue实例上
  router,
  // 渲染App根组件到页面上
  render: h => h(App)
}).$mount('#app')
